package cn.jiyun.service;

import cn.jiyun.dao.GoodsMapper;
import cn.jiyun.entity.Goods;
import cn.jiyun.vo.GoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class GoodsService {
    @Autowired(required = false)
    private GoodsMapper goodsMapper;
    public List<GoodsVo> findAll() {
        return goodsMapper.findAll();
    }

    public void addgoods(Goods goods) {
        goodsMapper.insertSelective(goods);
    }

    public Goods toedit(Integer id) {
       return goodsMapper.toedit(id);

    }

    public void editgoods(Goods goods) {
        goodsMapper.editgoods(goods);
    }

    public void del(Integer id) {
        goodsMapper.del(id);
    }

    public void tos(Integer id) {
        goodsMapper.tos(id);
    }

    public void tox(Integer id) {
        goodsMapper.tox(id);
    }
}
